package az.studio.gaokaowidget;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.Log;
import android.widget.RemoteViews;
import java.util.Arrays;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;

public class GaokaoWidget extends AppWidgetProvider
{
  static final String PREFS_NAME = "az.studio.gaokaowidget.GaokaoConf";
  private static final String TAG = "GaokaoWidget";

  public static long getUntilDays(int paramInt1, int paramInt2, int paramInt3)
  {
    TimeZone localTimeZone = TimeZone.getTimeZone("GMT+08:00");
    GregorianCalendar localGregorianCalendar1 = new GregorianCalendar(localTimeZone);
    GregorianCalendar localGregorianCalendar2 = new GregorianCalendar(localTimeZone);
    localGregorianCalendar2.set(paramInt1, paramInt2 - 1, paramInt3);
    return ((localGregorianCalendar2.getTimeInMillis() - localGregorianCalendar1.getTimeInMillis()) / 1000L / 86400L);
  }

  static void updateAppWidget(Context paramContext, AppWidgetManager paramAppWidgetManager, int paramInt)
  {
    String[] arrayOfString1 = GaokaoConf.loadPref(paramContext, paramInt);
    String str1 = arrayOfString1[0];
    String str2 = arrayOfString1[1];
    Integer localInteger = Integer.valueOf(Integer.parseInt(arrayOfString1[2]));
    String[] arrayOfString2 = str2.split("-");
    long l = getUntilDays(Integer.parseInt(arrayOfString2[0]), Integer.parseInt(arrayOfString2[1]), Integer.parseInt(arrayOfString2[2]));
    String str3 = str1 + paramContext.getResources().getString(2131034113);
    int i;
    //label148: PendingIntent localPendingIntent;
    RemoteViews localRemoteViews;
    switch (localInteger.intValue())
    {
    default:
      i = 2130837507;
      Intent localIntent = new Intent(paramContext, GaokaoConf.class);
      localIntent.setAction("az.studio.gaokaowidget.GaokaoConf" + paramInt);
      localIntent.putExtra("appWidgetId", paramInt);
    //  localPendingIntent = PendingIntent.getActivity(paramContext, 0, localIntent, 0);
      localRemoteViews = new RemoteViews(paramContext.getPackageName(), 2130903042);
      localRemoteViews.setImageViewResource(2131165197, i);
 //     localRemoteViews.setTextViewText(2131165200, l);
      Integer[] arrayOfInteger = new Integer[20];
      arrayOfInteger[0] = Integer.valueOf(0);
      arrayOfInteger[1] = Integer.valueOf(1);
      arrayOfInteger[2] = Integer.valueOf(2);
      arrayOfInteger[3] = Integer.valueOf(3);
      arrayOfInteger[4] = Integer.valueOf(4);
      arrayOfInteger[5] = Integer.valueOf(5);
      arrayOfInteger[6] = Integer.valueOf(7);
      arrayOfInteger[7] = Integer.valueOf(10);
      arrayOfInteger[8] = Integer.valueOf(20);
      arrayOfInteger[9] = Integer.valueOf(30);
      arrayOfInteger[10] = Integer.valueOf(40);
      arrayOfInteger[11] = Integer.valueOf(50);
      arrayOfInteger[12] = Integer.valueOf(60);
      arrayOfInteger[13] = Integer.valueOf(70);
      arrayOfInteger[14] = Integer.valueOf(80);
      arrayOfInteger[15] = Integer.valueOf(90);
      arrayOfInteger[16] = Integer.valueOf(100);
      arrayOfInteger[17] = Integer.valueOf(150);
      arrayOfInteger[18] = Integer.valueOf(200);
      arrayOfInteger[19] = Integer.valueOf(300);
      if (!(Arrays.asList(arrayOfInteger).contains(Integer.valueOf((int)l))))
    //    break label570;
      localRemoteViews.setTextColor(2131165200, Color.rgb(255, 0, 0));
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    }
    while (true)
    {
//      localRemoteViews.setTextViewText(2131165198, str3);
//      localRemoteViews.setTextViewText(2131165199, str2);
  //    localRemoteViews.setOnClickPendingIntent(2131165196, localPendingIntent);
   //   paramAppWidgetManager.updateAppWidget(paramInt, localRemoteViews);
      return;
//      i = 2130837507;
//      break label148:
//      i = 2130837512;
//      break label148:
//      i = 2130837511;
//      break label148:
//      i = 2130837514;
//      break label148:
//      i = 2130837508;
//      break label148:
//      i = 2130837510;
//      break label148:
//      i = 2130837513;
//      break label148:
//      i = 2130837509;
//      break label148:
//      label570: localRemoteViews.setTextColor(2131165200, Color.rgb(255, 255, 255));
    }
  }

  public void onUpdate(Context paramContext, AppWidgetManager paramAppWidgetManager, int[] paramArrayOfInt)
  {
    Log.d("GaokaoWidget", "onUpdate");
    int i = paramArrayOfInt.length;
    for (int j = 0; ; ++j)
    {
      if (j >= i)
      {
        super.onUpdate(paramContext, paramAppWidgetManager, paramArrayOfInt);
        return;
      }
      int k = paramArrayOfInt[j];
      new Timer().scheduleAtFixedRate(new ATime(paramContext, paramAppWidgetManager, k), 1L, 3600000L);
    }
  }

  public class ATime extends TimerTask
  {
    int appWidgetId;
    AppWidgetManager appWidgetManager;
    Context context;

    public ATime(Context paramContext, AppWidgetManager paramAppWidgetManager, int paramInt)
    {
      this.context = paramContext;
      this.appWidgetManager = paramAppWidgetManager;
      this.appWidgetId = paramInt;
    }

    public void run()
    {
      GaokaoWidget.updateAppWidget(this.context, this.appWidgetManager, this.appWidgetId);
    }
  }
}

/* Location:           E:\Desktop\Android\考试倒计时.apk\classes_dex2jar.jar
 * Qualified Name:     az.studio.gaokaowidget.GaokaoWidget
 * JD-Core Version:    0.5.3
 */